package com.wish.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wish.dto.LogDto;
import com.wish.entity.SysLog;
import com.wish.service.ISysLogService;
import com.wish.vo.LogVo;
import com.wish.vo.ResultEntity;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.sql.Wrapper;
import java.util.List;

/**
 * <p>
 * 系统日志表 前端控制器
 * </p>
 *
 * @author 五组
 * @since 2021-03-22
 */
@RestController
@RequestMapping("/wish/sys-log")
public class SysLogController {
    @Resource
    private ISysLogService iSysLogService;

    @RequestMapping("selects")
    public ResultEntity selects(SysLog sysLog,LogDto logDto){
        PageHelper.startPage(logDto.getPageNum(),logDto.getPageSize());
        if(sysLog.getUsername()!=null){
            sysLog.setOperation(sysLog.getUsername());
        }
        List<SysLog> list = iSysLogService.selects(sysLog);
        PageInfo<SysLog> sysLogPageInfo = new PageInfo<>(list);
        return ResultEntity.ok("200","查询成功",sysLogPageInfo);

    }

}
